/*
 * @# Main.java 2011-11-8 下午12:45:27
 * 
 * Copyright (C) 2010 - 2011 广州羿安信息科技有限公司
 * Guangzhou ianswer information technology co. ltd.
 * 
 * All rights reserved!
 */
package com.ianswer.experiments.redis;

import org.apache.commons.lang.ArrayUtils;

/**
 * @author alvin hwang
 */
public class Main {

	public static void main(String[] args) {
		String type = args[0];
		
		int threadCount = 10;
		int requestCount = 1000;
		boolean same = true;
		
		if (ArrayUtils.isNotEmpty(args) && args.length > 3) {
			threadCount = Integer.valueOf(args[1]);
			requestCount = Integer.valueOf(args[2]);
			same = Boolean.valueOf(args[3]);
		}
		if ("multicache".equals(type)) {
			new CacheAndDbMultiThreadCase().run(threadCount, requestCount, same);
		}
		if ("multidb".equals(type)) {
			new NoneCacheMultiThreadCase().run(threadCount, requestCount, same, "getcache".equals(args[4]));
		}
	}

}
